package edu.ptu.communityplatform.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import edu.ptu.communityplatform.domain.entity.Role;
import edu.ptu.communityplatform.mapper.RoleMapper;
import edu.ptu.communityplatform.service.IRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @BelongsProject: communityPlatform
 * @BelongsPackage: edu.ptu.communityplatform.service.impl
 * @Author: HYJ
 * @CreateTime: 2025-04-07  19:08
 * @Description: TODO
 * @Version: 1.0
 */
@Service("roleService")
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {
    @Resource
    private RoleMapper roleMapper;


    /**
     * 根据角色ID获取角色名称
     *
     * @param roleId 角色ID
     * @return 角色名称
     */
    @Override
    public String getRoleNameByRoleId(Integer roleId) {
        return roleMapper.getRoleNameByRoleId(roleId);
    }
}
